﻿/*using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace CSharpHomework6_2
{
    public partial class Form4 : Form
    {
        public Form4()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {

        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {

        }

        private void Form4_Load(object sender, EventArgs e)
        {

        }
    }
}
*/

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace CSharpHomework6_2
{
    public partial class Form4 : Form
    {

        AllOrder a = AllOrder.getInstance();
        BindingSource bindingSource = new BindingSource();
        
        public Form4()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {

            bindingSource.DataSource = a.searchOrder(3, textBox1.Text);
            table.DataSource = bindingSource;
            bindingSource.ResetBindings(true);
        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {

        }

        private void table_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {

        }

        /*private void button2_Click(object sender, EventArgs e)
        {

            bindingSource.DataSource = a.searchOrder(1, textBox2.Text);
            table.DataSource = bindingSource;
        }

        private void button3_Click(object sender, EventArgs e)
        {

            bindingSource.DataSource = a.searchOrder(2, textBox3.Text);
            table.DataSource = bindingSource;
        }
        */
        private void button2_Click_1(object sender, EventArgs e)
        {
            bindingSource.DataSource = a.searchOrder(1, textBox2.Text);
            table.DataSource = bindingSource;
            bindingSource.ResetBindings(true);
        }

        private void button3_Click_1(object sender, EventArgs e)
        {
            bindingSource.DataSource = a.searchOrder(2, textBox3.Text);
            table.DataSource = bindingSource;
            bindingSource.ResetBindings(true);
        }

        private void table_CellContentClick_1(object sender, DataGridViewCellEventArgs e)
        {

        }
    }
}
